#include <bits/stdc++.h>
using namespace std;
#define int long long
void solve()
{
    string s;
    cin>>s;
    string a,b;
    int n=s.size();
    int x=0,y=0;
    for(int i=0;i<s.size()-1;i++)
    {
        if(s[i]=='(')x++;
        else y++;
        if(x<=y)
        {
            cout<<"YES"<<endl;
            return ;
        }
    }
    // if(x>y)cout<<"NO"<<endl;
    // else cout<<"YES"<<endl;
    cout<<"NO"<<endl;
}
signed main()
{
    //ios::sync_with_stdio(false);
    //cin.tie(nullptr);
    int T=1;
    cin>>T;
    while(T--)
    {
       solve();
    }
    return 0;
}